﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PlayerScanner
{
    /// <summary>
    /// Interaction logic for SettingsWindow.xaml
    /// </summary>
    public partial class SettingsWindow : Window
    {
        public SettingsWindow()
        {
            InitializeComponent();

            DataContext = Properties.Settings.Default;
        }

        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            //Prevent window closing. Simply hide the window instead.
            e.Cancel = true;
            base.OnClosing(e);

            Hide();
        }

        private void ResetButtonClick(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.Reset();
        }

        private void SaveButtonClick(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.Save();
        }
    }
}
